/**
 * 
 */
package us.gaaoc.framework.dao;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;

import com.lowagie.text.Document;

import us.gaaoc.framework.model.CaseRecord;
import us.gaaoc.framework.model.DocumentStatus;
import us.gaaoc.framework.model.Documents;

/**
 * @author Sukahda Tapshalkar
 * Aug 17, 2006
 *
 */
public class DocumentStatusDAOHibernate extends GenericHibernateDAO<DocumentStatus, Integer, DocumentStatusDAO>
implements  DocumentStatusDAO{
	
	public List<String> getDocumentStatusDescriptionList() {
		List<String> documentStatusDescriptionList = new ArrayList<String>();
		String sql = "SELECT description FROM DocumentStatus";
		Query q = getSession().createQuery(sql);
		documentStatusDescriptionList = (List<String>)q.list();
        return documentStatusDescriptionList;
	}
	
	public int findDocumentStatusCode(String documentStatusDescription) {
		String sql = "SELECT code FROM DocumentStatus where description=?";		
		Query q = getSession().createQuery(sql);
		q.setString(0, documentStatusDescription);
		Integer documentStatusCode = (Integer)q.uniqueResult();
        return documentStatusCode.intValue();
	}

	
	
	
}
